package main

import (
    //mylib is a subfolder of the root folder containing main.go, but the root folder is not in $GOPATH or $GOROOT. So when trying to import mylib throught the path "rootfolder/mylib", it can't be found.
    //In order to use packages in the subfolders, there are 2 choices. The first is use a ralative path to the importing file as import path, such as "./mylib" for main.go. But this needs the import path to vary for different importing files, and only files also in the root folder can use this way to import. I call this way as "relative import".
    //The other is put the root folder into the `src` folder which is contained in $GOPATH or $GOROOT. Then all files can use the ralative path to `src`(it means the root folder name must be included) as the import path to import the packages under root folder. That is why we have to put all the projects root folders in $GOPATH/src before Go module appears. Doing so can expose all packages under root folder to all go files to import, not only to the go files in root folder, but also to any other go files on the same machine. Because $GOPATH/src and $GOROOT/src can be considered as the absolute root folder for importing, all files can use import path relative to this absolute root folder to import packages. I call this "absolute import".
    //Here we can put the project root folder `gopath` which containing main.go to $GOPATH/src(namely ~/go/src) or $GOROOT/src, then use "gopath/mylib" to import mylib package.
    //After `vendor` folder is considered as a special folder from Go 1.6, then the dependency package "absolute import" search steps are as the following(using $GOPATH and not using Go module):
    //1. This requires the project root folder to be put in $GOPATH/src or $GOROOT/src, there may be several folders named `vendor` in projects root folder or subfolders
    //2. When a go source code file imports a package, it searches the `vendor` folder in the current folder containing this source code file, if `vendor` folder exists and the import path matches a folder or a subfolder in this `vendor`, then the package of the matched folder will be imported.
    //4. If `vendor` folder not exists in current folder, then searches its parent folder, grandparent folder, and the uplevel folders sequencially till reaches the project root path(which is contained in $GOPATH/src or $GOROOT/src). The first folder in a `vendor` which matches the import path during the search process, its package will be imported.
    //5. If no `vendor` folder found in the whole searching process, then the first folder in $GOPATH/src and $GOROOT/src which matches the imort path, its package will be imported.
    //In other words, when importing a package, the searching starts from the `vender` folder in current directory, then recursively to an uplevel `vender` folder till the project root, then to the `src` folders contained in $GOPATH, finally to the `src` folders contained in $GOROOT 
    "./mylib"
)

func main() {
    mylib.Show()
}
